package com.zerui.manager.accessrecord.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

/**
 * @Author wh
 * @create_time 2023-08-23 15:28
 */
@ApiModel("通行记录")
@Data
@ToString
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName(value = "tb_access_record",autoResultMap = true)
public class AccessRecordDo {

	@ApiModelProperty("主键，无业务含义")
	@TableId(value="id",type= IdType.ASSIGN_ID)
	@JsonFormat(shape = JsonFormat.Shape.STRING)
	private Long id;

	@ApiModelProperty("人员id")
	private String personnelId;

	@ApiModelProperty("人员姓名")
	private String personnelName;

	@NotEmpty(message = "人员类型不能为空")
	@ApiModelProperty("人员类型 字典值")
	private String personType;

	@NotNull(message = "所属公司/组织不能为空")
	@ApiModelProperty("所属公司/组织id")
	@JsonFormat(shape = JsonFormat.Shape.STRING)
	private Long orgId;

	@ApiModelProperty("所属公司/组织名称")
	private String orgName;

	@ApiModelProperty("设备id")
	private String deviceId;

	@ApiModelProperty("设备名称")
	private String deviceName;

	@ApiModelProperty("设备编码")
	private String deviceCode;

	@ApiModelProperty("设备位置")
	private String position;

	@ApiModelProperty(value="通行状态")
	private String passStatus;

	@ApiModelProperty("进出方向 0：进 1：出")
	private String access;

	@ApiModelProperty("物联网通行记录id")
	private String recordId;

	@ApiModelProperty("通行方式 1：人脸  2：密码 3：刷卡 4：身份证 5：指纹 6：人证合一 7：人卡合一 8：人证对比 9：二维码 10：远程开门")
	private String mode;

	@ApiModelProperty(value="通行时间")
	private String time;

	@ApiModelProperty(value="创建时间")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private LocalDateTime createTime;
}
